import mongoose from "../db/mongoose";

interface EventSchema {
  eventKey: string; // uuid
  evemtData: {
    pv: number;
    uv: number;
  };
  eventDate: Date; // 当天的时间
}

const schema = new mongoose.Schema(
  {
    eventKey: String,
    eventData: {
      pv: Number,
      uv: Number,
    },
    eventDate: Date,
  },
  { timestamps: true },
);

const EventModel = mongoose.model<EventSchema>("event_analytice_data", schema);

export default EventModel;
